package com.violet.controller;

import com.violet.domain.result.StatisticalData;
import com.violet.utils.StatisticsUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/statistics")
@RequiredArgsConstructor
@CrossOrigin
public class HomeController {

    private final StatisticsUtils statisticsUtils;

    @GetMapping
    public StatisticalData home() {
        return statisticsUtils.generate();
    }

}
